package br.senai.sc.web.components;

import javax.faces.component.FacesComponent;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UINamingContainer;
import javax.faces.component.html.HtmlInputText;

/**
 * @author Fernando Marquardt &lt;fernando.marquardt@sc.senai.br&gt;
 * @since 09/02/2012
 * @version $Id: InputNumber.java 28 2012-03-07 20:48:20Z fernando.marquardt $
 */
@FacesComponent(InputNumber.COMPONENT_TYPE)
public class InputNumber extends UIComponentBase implements NamingContainer {

    public static final String COMPONENT_TYPE = "br.senai.sc.hidroData.InputNumber";

    private HtmlInputText input;

    public String getEscapedClientId() {
        return getClientId().replace(":", "\\\\:");
    }

    public HtmlInputText getInput() {
        if (input == null) {
            input = (HtmlInputText) findComponent("inputText");
        }

        return input;
    }

    @Override
    public String getFamily() {
        return UINamingContainer.COMPONENT_FAMILY;
    }
}